Tag: tablelayout

Android,并在TableRow的TextView中显示多行文字

我正在显示一个TableLayout,如下所示: <?xml version="1.0" encoding="utf-8"?> <TableRow xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/one" android:layout_marginLeft="10dip" android:textColor="#B0171F" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/one" android:id="@+id/two" android:layout_marginLeft="10dip" android:ellipsize="none" android:singleLine="false" android:scrollHorizontally="false" android:maxLines="10" android:textColor="@android:color/black" /> </RelativeLayout> </TableRow> 我正在用我在这里find的所有东西来打这个东西,可以想到允许文本在多行上打包,但无济于事:文本总是被强制为一行,从屏幕上跑出来。 这可能是我在TableRow里面工作,据我所知,这个网站上没有处理。 那么,如何强制我的第二个TextView换行呢?

你如何在CSS中指定表格填充? (表格,而不是单元格填充)

我有一个带有彩色背景的表,我需要指定表和它的内容,IE单元格之间的填充。 表标记似乎不接受填充值。 Firebug使用填充0来显示表格和tbody的布局,但不接受为它们input的任何值,所以我想他们只是没有填充属性。 但事情是我想单元格之间的相同的分离比顶部单元格与桌面和底部单元格与表底部。 再次,我想要的不是细胞填充。 编辑:谢谢,我真正需要的,现在我意识到,是边界间距,或其等效的html,cellspacing。 但由于某种原因,他们在我正在工作的网站上没有做任何事情。 两者都在单独的HTML上工作,但在网站中却没有。 我认为这可能是一些风格覆盖属性,但细胞间距和内联的边界间距不应该被覆盖,对吧? (我使用Firefox) 编辑2:不,TD填充不是我所需要的。 使用TD填充时,相邻单元格的顶部和底部填充总括起来,因此两个单元格之间的空间(实际上是填充)比顶部单元格和桌面顶部边框之间的空间增加了一倍。 我想要在他们之间有完全相同的距离。

如何CSS“显示:表列”应该工作?

鉴于下面的HTML和CSS,我在浏览器中看不到任何东西(在编写本文时Chrome和IE最新版本)。 一切都崩溃到0x0像素。 为什么? <!DOCTYPE html> <html> <head> <style type="text/css"> section { display: table; height: 100%; background-color: grey; } #colLeft { display: table-column; height: 100%; background-color: green; } #colRight { display: table-column; height: 100%; background-color: red; } #row1 { display: table-row; height: 100%; } #row2 { display: table-row; height: 100%; } #row3 { display: table-row; height: […]

Android中的多行TextView?

我在xml如下所示 <TableRow> <TextView android:id="@+id/address1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="left" android:maxLines="4" android:singleLine="false" android:text="Johar Mor, Gulistan-e-Johar, Karachi" > </TextView> </TableRow> 它不适用于multiline ,我正在使用TableLayout … 所以我在这里做错了什么?

如何在Android中创build一个带有边框的表格?

我使用表格布局来显示数据为表,但我想要一个用户定义的列和行的边界的表。 build议?

在Android中设置表格布局的相等宽度

可能重复: XML表格布局? 两个等宽的行填充了等宽的button? 我使用TableLayout来显示4列中的数据列表。 问题描述: 我无法设置我的TableLayout的所有4列的等宽。 我把我的布局代码,我正在使用… <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="0"> <TableRow> <TextView android:text="table header1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="10dip" android:textStyle="bold"/> <TextView android:text="table header2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="10dip" android:textStyle="bold"/> <TextView android:text="table header3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="10dip" android:textStyle="bold"/> <TextView android:text="table header4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="10dip" android:textStyle="bold"/> </TableRow> </TableLayout> 我应该如何重写这个布局来显示4列的大小相等?

CSS:截断表单元格,但尽可能适合

与Fred见面。 他是一张桌子: <table border="1" style="width: 100%;"> <tr> <td>This cells has more content</td> <td>Less content here</td> </tr> </table> 弗雷德的房子有一个奇怪的改变大小的习惯,所以他学会了隐藏他的一些内容,以免推动所有其他单位,把惠特福德太太的起居室遗忘了: <table border="1" style="width: 100%; white-space: nowrap; table-layout: fixed;"> <tr> <td style="overflow: hidden; text-overflow: ellipsis">This cells has more content</td> <td style="overflow: hidden; text-overflow: ellipsis">Less content here</td> </tr> </table> 这样做很有效,但是弗雷德有一种唠叨的感觉,如果他的右边格子(他被戏称为塞尔利多)放弃了一点空间,他的左格将不会被截断。 你能保存他的理智吗? 总之:一个表格的单元格如何均匀地溢出,只有当它们全部放弃了空格时

以编程方式将TableRow添加到TableLayout不起作用

我试图通过编程方式在这里添加表格行 /* Find Tablelayout defined in main.xml */ TableLayout tl = (TableLayout) findViewById(R.id.SaleOrderLines); /* Create a new row to be added. */ TableRow tr = new TableRow(this); tr.setLayoutParams(new TableRow.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); /* Create a Button to be the row-content. */ Button b = new Button(this); b.setText("Dynamic Button"); b.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); /* Add Button to row. */ […]