Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasting in nested tables that contains a font-size style results in a width of 100% being added #4766

Open
timandella opened this issue Mar 22, 2024 · 0 comments

Comments

@timandella
Copy link

When pasting in a table, (with a nested table), a width style of 100% is being added to the nested table, causing it to expand to fill the parent cell. This seems to occur when a font-size style attribute is added. The "tableDefaultWidth" option is being set in Froala to "auto"

Expected behavior.

Nested table should not have the width style added,

Actual behavior.

Nested table is given a width of 100%, resulting in it expanding to fill the current cell

Steps to reproduce the problem.

This table, when pasted in (from a browser), has the nested table expanded

<table style='width: 780px;'>
	<tbody>
		<tr>
			<td>
				<table style="font-size: 10px;">
					<tbody>
						<tr><td>A</td><td>B</td><td>C</td><td>D</td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
	</tbody>
</table>

This table, when pasted in, does not have the width style added

<table style='width: 780px;'>
	<tbody>
		<tr>
			<td>
				<table>
					<tbody>
						<tr>
							<td>A</td><td>B</td><td>C</td><td>D</td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
	</tbody>
</table>

See https://jsfiddle.net/0yjns8x5/

Editor version.

Occurs in v4.2.0. Was previously working in v4.1.14

OS.

Linux

Browser.

Microsoft Edge

Recording.

Not a recording, but the previous js fiddle, using the html, shows the following:
image

Notes

Yes, embedded tables are a "bad thing", but the system involved has many legacy components, and the HTML it spews out isn't going to change anytime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant