473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Very very simple table question

I'm having a tough time getting text and image to align in a table.
When I add the image for some reason the text in that cell shifts to
the bottom of the cell. Below is the code and the result. How can
get everything to align in the vertical middle? Thank you.

<table>
<tr>
<td>
<img src="picture.gif">
TEXT_A
</td>
<td>
TEXT_B
</td>
</tr>
</table>

+--------------------+----------------+
|+-----+ | |
|| Pic | |TEXT_B |
|+-----+ TEXT_A | |
+--------------------+----------------+
Jul 20 '05 #1
4 1581
On Thu, 22 Jan 2004 12:42:59 -0800, Daniel wrote:
How can get everything to
align in the vertical middle?


<td valign=center>

--

..

Jul 20 '05 #2
Vigil <me@privacy.net> wrote:
On Thu, 22 Jan 2004 12:42:59 -0800, Daniel wrote:
How can get everything to
align in the vertical middle?


<td valign=center>


Wrong.
valign="middle" to vertically center content within a cell.
align="center" to horizontally center content within a cell.

However, this won't work for the OP unless he moves the image into a
separate cell (BTW valign="middle" is the default, as the OP's sample
didn't have any other value set it would have been working already if
this was the solution).

The solution is to set align="left" or float: left; on the image. (Or
align="middle" if it can 100% definite that the text will not wrap
onto another line).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3
si********@hotmail.com (Daniel) wrote in message news:<a3**************************@posting.google. com>...
I'm having a tough time getting text and image to align in a table.
When I add the image for some reason the text in that cell shifts to
the bottom of the cell. Below is the code and the result. How can
get everything to align in the vertical middle? Thank you.

<table>
<tr>
<td>
<img src="picture.gif">
TEXT_A
</td>
<td>
TEXT_B
</td>
</tr>
</table>

+--------------------+----------------+
|+-----+ | |
|| Pic | |TEXT_B |
|+-----+ TEXT_A | |
+--------------------+----------------+


If you try aligning the image, you should get the text to wrap round
it and not go straight to the bottom... Something like

<table>
<tr>
<td valign='middle'><img src='picture.gif' align='left'> TEXT_A</td>
<td valign='middle'>TEXT_B</td>
</tr>
</table>

That should (I think, although I am doing from memory) work out like
below...

+--------------------+----------------+
|+-----+ | |
|| Pic | TEXT_A |TEXT_B |
|+-----+ | |
+--------------------+----------------+
Jul 20 '05 #4
Thank you all for your help. The code Chris provided worked perfectly.

-daniel

ch***@mkttl.co.uk (Topher) wrote in message news:<f4*************************@posting.google.c om>...
si********@hotmail.com (Daniel) wrote in message news:<a3**************************@posting.google. com>...
I'm having a tough time getting text and image to align in a table.
When I add the image for some reason the text in that cell shifts to
the bottom of the cell. Below is the code and the result. How can
get everything to align in the vertical middle? Thank you.

<table>
<tr>
<td>
<img src="picture.gif">
TEXT_A
</td>
<td>
TEXT_B
</td>
</tr>
</table>

+--------------------+----------------+
|+-----+ | |
|| Pic | |TEXT_B |
|+-----+ TEXT_A | |
+--------------------+----------------+


If you try aligning the image, you should get the text to wrap round
it and not go straight to the bottom... Something like

<table>
<tr>
<td valign='middle'><img src='picture.gif' align='left'> TEXT_A</td>
<td valign='middle'>TEXT_B</td>
</tr>
</table>

That should (I think, although I am doing from memory) work out like
below...

+--------------------+----------------+
|+-----+ | |
|| Pic | TEXT_A |TEXT_B |
|+-----+ | |
+--------------------+----------------+

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: robin | last post by:
I need to do a search through about 50 million records, each of which are less than 100 bytes wide. A database is actually too slow for this, so I thought of optimising the data and putting it all...
0
by: roiavidan | last post by:
Hi, I'm having a bit of a problem with a small application I wrote in C#, which uses an Access database (mdb file) for storing financial data. After looking for a similiar topic and failing to...
4
by: ruca | last post by:
Hi, I have an web application with fields that must be the filters for some results. To show the result I have a datagrid. So far so good. To distinguish filter fileds from datagrid I put a...
14
by: Steve | last post by:
Sorry in advance for my ignorance. Any help would sure be appreciated. I'm writing a fairly simple application with VB.Net and am obviously a bit of a newbie. This application will be used by 1,...
2
by: dave | last post by:
Hi, I have searched for the answer for this error message without success. I have seen the question many times though:) I create an ASP.NET project (VS 2005, C#), and use a very simple .mdf...
13
by: Jack B | last post by:
I'm using Access 2002 to create a database for a small opera company that my wife is involved in, and I'm more than a bit rusty because I haven't created a new Access database since about 1999. ...
3
by: Tarik Monem | last post by:
You guys have been very helpful. Even if the solution was not presented in the reply, then you would at least spark a thought which would lead to the solution and I am very grateful for your...
1
by: Raycaster | last post by:
I'm 3/4 finished 2 simple VB apps for a upcoming silent auction being held at my children's school. Very Simple - This is what it does: 1st app allows input and builds a text database Unit...
1
by: pitjpz | last post by:
We have moved our Database to another server. The server it was on used SQL 4 and the new one its on now uses SQL5 the only problem we can find is that when you attempt to delete a record from...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.