Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a border for whole table

Tags:

xml

xslt

xsl-fo

I have to draw solid lines as border.

I am using this loc

<fo:table border="solid 0.1mm black">

but it draws only surrounded lines. It is not applied to all cells and rows. Is it possible to draw solid lines as borders with minimum coding, like not setting borders for cell and rows separately as:

<fo:table-row  border="solid 0.1mm black">
like image 242
Amit Singh Avatar asked Sep 25 '13 13:09

Amit Singh


People also ask

How do I add a border to my whole table?

Complete HTML/CSS Course 2022 To create table border in HTML, the border attribute was used. But the introduction of HTML5, deprecated the border tag. Create table border using the CSS property border. Set table border as well as border for <th> and <td>.

How do you put a border on all tables in Word?

Add borders to a whole table or to selected table cells. Click the table or select the cells to which you want to add borders. On the Tables tab, under Draw Borders, click Borders, and then click the borders that you want.

How do you customize a table border?

Go to Table Tools >Design > Table Styles > Borders, and then click the border option that you want to change.


1 Answers

Add the border attribute to all table-cell elements. You can see here that borders are not inherited: http://www.w3.org/TR/xsl11/#border

While it doesn't save any typing, you could help future support of your stylesheet by using attribute sets:

<xsl:attribute-set name="myBorder">
  <xsl:attribute name="border">solid 0.1mm black</xsl:attribute>
</xsl:attribute-set>
...
  <fo:table-cell xsl:use-attribute-sets="myBorder">
    ...

Then, when you need to change all, you just change it in one place.

like image 148
G. Ken Holman Avatar answered Oct 09 '22 15:10

G. Ken Holman