WeBWorK Problems

Can we specify for a border around a given cell of a table?

Can we specify for a border around a given cell of a table?

by tim Payer -
Number of replies: 2
I am assuming that this is not possible with HTML code, but thought I would ask:

Can we specify that a given cell of a data table have a border while the remaining cells of the table are without borders?

I would like to use a data table made of two adjacent cells; using wrapped text without a border on the cell on the left, then the cell on the right would use a border to indicate summarized values, or an arrangement of answer cells.

Thanks for any feedback,

Tim


In reply to tim Payer

Re: Can we specify for a border around a given cell of a table?

by Alex Jordan -
Assuming you are using niceTables.pl, you can get this for the HTML output with something like:

[23, cellcss => 'border:1px solid black;', ]

for a cell with "23" as the data.

But for the PDF, it's not possible to give one specific cell top and bottom borders. In LaTeX, this would require a \cline command between the rows, and the macro isn't built to be able to do that. You could give the cell left and right borders like

[23, halign => '|c|', cellcss => 'border:1px solid black;', ]

but I don't know that you would want that if you don't get top borders too.

Perhaps it would be acceptable to give the cell in question a background color instead of a border, and that could be done like:

[23, tex => '\cellcolor{gray}', cellcss => 'border:1px solid black;', ]

For a gray background in print but a black border in HTML.

In reply to Alex Jordan

Re: Can we specify for a border around a given cell of a table?

by tim Payer -
Thank You Alex.

That worked!  I am content with the pdf not having the individual blocked cell.

I will use this a lot! Thanks

Tim