Hello,

I am trying to create a table that has certain elements covered up. More specifically, I have a table and would like to have a cell in the table covered up (like a flashcard). I have been looking online but everything just sets the background color... I thought of just deleting the contents of the cell and setting a background color, but I would like to preserve the size of the cell. Any thoughts? Thank you in advance.

CA

I included a sample html table below.

<TABLE>
<TR>
<TH>Name</TH>
<TR>
<TD>John Smith</TD> # I would like to cover this cell for example to then reveal it later
<TR>
<TD>Joe</TD>
</TABLE>

Recommended Answers

All 2 Replies

If you set the background and font color the same, it will appear to be covered up. Alternatively, you could delete the contents of the cell, and have this value temporarily stored in a hidden input element <input type="hidden" value="#####" /> then use javascript to place the value back when some event happens.

Of course anything you do client side will be visible with client side tools. If you really want to hide the value, you are going to have to make a round trip back to the web server to retreive it. The best way for the user experience would be to retrieve it server side via AJAX.

Member Avatar for diafol

but I would like to preserve the size of the cell.

This can be hard-coded as inline property or via css/style.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.