dead space in table cell

39 views
Skip to first unread message

luserdroog

unread,
Dec 3, 2021, 10:21:58 PM12/3/21
to
I've got

<table>
<tr>
<td>
<a/>
</td>
</tr>
</table>

but there's space around the edges of the cell that don't
respond to clicks. Is there a way to maybe style the <td>
so the <a> takes up all the interior space? Is that "padding"
or something?

luserdroog

unread,
Dec 4, 2021, 12:23:13 AM12/4/21
to
Wait... is the answer 'functions'?!
It's got to be functions. But I don't see how.

JJ

unread,
Dec 4, 2021, 1:20:39 AM12/4/21
to
It's due to table cell's padding which is technically margins between cells,
rather than actual padding within cells. So, that space actually belong to
the table element.

If you don't want the padding, style the table with
`border-collapse:collapse`.

If you want the padding and still want then to be clickable, apply the above
style, then add padding style to the table cells.

Julio Di Egidio

unread,
Dec 4, 2021, 4:16:09 AM12/4/21
to
You fucking spamming retarded cunts. ESAD.

*Plonk*

Julio

John Harris

unread,
Dec 4, 2021, 6:46:25 AM12/4/21
to
On 04/12/2021 09:16, Julio Di Egidio wrote:
> On Saturday, 4 December 2021 at 07:20:39 UTC+1, JJ wrote:

<snip>
>> If you want the padding and still want then to be clickable, apply the above
>> style, then add padding style to the table cells.
>
> You fucking spamming retarded cunts. ESAD.
>
> *Plonk*
>
> Julio

Clicking is on-topic, padding is off-topic, so the two together is not
spamming. (Except for people wanting an excuse to flame.)

John

luserdroog

unread,
Dec 4, 2021, 9:15:44 PM12/4/21
to
Thanks. I already had "table { border-collapse: collapse }". So I added
"padding: 0" to the <th>s and <td>s and that's the thing. That's what I want.
It even looks nicer.

I can still find a mouse position right on the edges where clicking doesn't
do anything. But it's much harder to accidentally click there.
Reply all
Reply to author
Forward
0 new messages