Alignment problem with editable and non editable labels of pop up - css

I have a pop up which opens as all label type or editable type based on the condition.
When I open the pop up as editable, the table is set to center and values are properly
aligned. When I open the same in non editable mode, the values are more moved to the left.
I have uploaded both to JSFiddle for analysis. Please help
Pop up with editable condition
http://jsfiddle.net/gr2022s/C9BZJ/
Pop up with non editable condition
http://jsfiddle.net/gr2022s/C9BZJ/1/
I had done a workaround by adding <blockquote> tag to one of the label but the problem seems to be
the label is moved towards right from the others.

The reason is quite simple :
You never define any width for any <td>. So your <table> will scale each column according to the largest td content. And since your <input type="text /> is way larger than the simple text Ad Hoc, the editable table seems more centered...
Try this to test it :
<table border="1" width="300px">
<tr>
<td>content</td>
<td>content</td>
</tr>
</table>
<table border="1" width="300px">
<tr>
<td>a</td>
<td>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</td>
</tr>
</table>
<table border="1" width="300px">
<tr>
<td>aaaaaaa</td>
<td>aaa</td>
</tr>
</table>
Or see your updated jsFiddle.

Related

how to style ngtable with expandable detail?

I'm trying to style a ng-table layout, which contains a table in each row. The way this expanding functionality is implemented in angular, looks like this:
<tr ng-if="org.expanded" ng-repeat-end>
<td></td>
<td></td>
</tr>
The issue is more related to CSS.
The problem is that, when clicking on the plus icon next to the ServiceType column the 4 expanded columns aren't aligned with the parent tablecolumn headers i.e. Service Type, Location , Contact details and Last Updated.
How can I set it, that the values look nicely aligned(left)?
Also, I can't align the Last Updated column to the left.
Here is a plunkr sample of the problem:
http://embed.plnkr.co/UlMg7J/preview
http://plnkr.co/edit/UlMg7J?p=preview
For the last column not aligned issue I have replaced the table for phone,website..etc with divs and it started to align to the position you desired. What it was doing was it was creating extra headers (th) tags which is not desired.
Your Code:
<td data-title="'Contact Details'">
<table>
<tr>
<td>Phone:</td>
</tr>
<tr>
<td>Fax:</td>
</tr>
<tr>
<td>Email:</td>
</tr>
<tr>
<td>Website:</td>
</tr>
</table>
</td>
Changed Code:
<td data-title="'Contact Details'">
<div>Phone:</div>
<div>Fax:</div>
<div>Email:</div>
<div>Website:</div>
</td>

Table auto-scroll with min height

I'm using Twitter Bootstrap and I have a pretty annoying problem.
I have a table (call F) with a row and two cells, in the first cell I have another table (called T) and in the second cell some content (called C), see http://jsfiddle.net/mcJvU/.
<table>
<tr><td>
<table class="table table-striped">
<thead>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
<th>e</th>
<th>f</th>
</thead>
<tbody>
<tr><td>1</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>2</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>3</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>4</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>5</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>6</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>7</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>8</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>9</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
<tr><td>10</td><td>m</td><td>n</td><td>o</td><td>p</td><td>q</td></tr>
</tbody>
</table>
</td>
<td>
some<br/>
big<br/>
enough<br/>
content<br/>
but<br/>
may<br/>
be<br/>
empty
</td>
</tr>
</table>
Here is the big deal: T has to contain a huge number of rows and C doesn't have much content, it may be empty.
I want that that T takes all the avaliable place or, if C is smaller, at least prints 3 rows.
I tried fixedheadertable but it is a fixed size height and it has some bugs.
Edit: by "at least prints 3 rows", I mean that T must have a min height that allows to display at least three rows".
Finally I make it fixed in pure CSS.
Thanks to this: Twitter Bootstrap scrollable table rows and fixed header
Then I have no more print issues.

Table-layout: fixed - IE8 delay render problem with dynamic content

I am using a table with style table-layout:fixed to solve wrap problems. The table content is dynamic produced with PHP. When the page is rendered, many cells content doens't appear!
The content appear if I pass the mouse up the cell. If I resize the window manually, all the cell content appear!
What I can do? I accept any solution! Can be javascript, CSS, PHP...
Thanks!
Simone
It sounds like you need to style the headers in the first row of the table in order to establish a width for each column.
<table>
<tr>
<th style="width:100px;">Header 1</th>
<th style="width:100px;">Header 2</th>
</tr>
<tr>
<td>Value 1</td>
<td>Value 2</td>
</tr>
</table>

How to set size for divs with different parents

I want to create a div layout which is similiar to the following table result:
<html>
<head>
<title>Basic</title>
<style>
table { border: 1px solid;}
</style>
</head>
<body>
<table style="border: 1px solid;">
<tr>
<td> Asia</td>
<td>
<table>
<tr>
<td>South Asia</td>
</td>
<td><table>
<tr>
<td>Republic</td>
<td><table>
<tr><td>Singapore</td></tr>
<tr><td>India</td></tr>
</table></td>
</tr>
<tr>
<td>Monarchy</td>
<td><table>
<tr><td>Bhutan</td></tr>
<tr><td>Nepal</td></tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td>East Asia</td>
<td><table>
<tr>
<td>Republic</td>
<td><table>
<tr><td>China</td></tr>
<tr><td>South Corea</td></tr>
</table></td>
</tr>
<tr>
<td>Constitutional Monarchy</td>
<td><table>
<tr><td>something</td></tr>
<tr><td>Japan</td></tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
I managed to replicate this with some effort. The problem is that I want the names of the countries to be in a column or if you will - the containers for the government types to be the same width so other containers will align.
If I don't do it in nested containers (in the example - nested tables) the rows will get displaced. Currently rows are shown exactly how I want them - the text is in the vertical middle of the what they refer to.
Only thing that comes up to my mind is to set the text in the same columns as class=column1, class=column2, etc. and then somehow define the width for the column classes. Problem is the data is defined dynamically and I can't say how much pixels or % of the page I can give to a column, I just need it to stretch with the text.
This is my first time I ask about help here so if I am doing it wrong, tell me how do improve my inquiry.
EDIT: I just read it a second time and I noticed my title doesn't match my question.
My second idea to work around this was to have more than one parent to a single div without the parents having a relation between them, is this even possible?
If you're looking for a decent grid framework for your CSS, I highly recommend blueprint. As for not knowing the pixel or % for the column, that will always be a problem. Are you able to 'play it safe' and just give them a large enough box to handle all text possibilities?

why TDs display within a TR displays in the same line?

TD is a block element,
but displays like inline,say,several TDs within a TR display in the same line,
why?
TD's are actually not technically "block" elements. Have a look at the CSS display property. Cells are technically of type "table-cell" and they are a special case.
There is also another type of display called "inline-block" which can be useful.
Because they are for tabular data.
Because, that's how tables work.
TR = table row. How else would you want it to behave?
If you want a <td> to display as a "block," simply add another <tr> below the current <tr>. This will effectively make the <td> act like a block-level element.
Let's say you have a table like this:
<table>
<tr>
<td>Table cell A</td>
<td>Table cell B</td>
</tr>
</table>
And you want "Table cell B" to act like a "block." You could do this:
<table>
<tr>
<td>Table cell A</td>
</tr>
<tr>
<td>Table cell B</td>
</tr>
</table>
This moves Table cell B below Table cell A.

Resources