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

Wrong spacing if rowspan is used #217

Closed
mapio opened this issue Nov 9, 2018 · 29 comments
Closed

Wrong spacing if rowspan is used #217

mapio opened this issue Nov 9, 2018 · 29 comments
Assignees

Comments

@mapio
Copy link

mapio commented Nov 9, 2018

Take the example at https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Basics, more specifically the code at https://github.com/mdn/learning-area/blob/master/html/tables/basic/animals-table-fixed.html and point it to this css instead of the provided one.

You get (with the latest Firefox on OSX) what you see in the attached image, which is not correct (Hen and Mare seem to have some white-space to their left).

screen shot 2018-11-09 at 16 36 03

@RamanaVem
Copy link

Is this still open? Can i take a look once?

@mapio
Copy link
Author

mapio commented Oct 29, 2019

Apparently yes, see the codepen https://codepen.io/mapio/pen/VwwzRrR (notice how "Mare" in the "Horse" row has a space in front of it, differently from "Stallion")

@RamanaVem
Copy link

RamanaVem commented Oct 30, 2019

hey @mapio i seen problem, where can i work this? can you make a Fork available in single html page?
I can't find table in milligram

@mapio
Copy link
Author

mapio commented Oct 31, 2019

I don't get you question and I'm not the mantainer of milligram… if you want to fix the bug, fork the repo and submit a pull request when done so that the repo owners can evaluate to accept it or not.

@Lisagrant101
Copy link

I opened a fork in this repo and submitted a pull request for my fix to this issue.
Im new to GitHub and not sure if I did this correctly.

@Lisagrant101
Copy link

oh I think I did this wrong. I just realized I edited an example file not a milligram file.

@Lisagrant101
Copy link

Ok I edited the minimal.css file from the milligram repo and I will see if they accept it or not.
I added classes so that when using rowspan and colspan the alignment of words in the subsequent columns is not thrown off.

@mapio
Copy link
Author

mapio commented Jan 2, 2020

Nope… I'm not the repo owner, but those files look to be generated (have a look at https://github.com/milligram/milligram/blob/master/.github/contributing.md#building) starting from sass files under the src directory.

To increase the chance of your PR being accepted, don't forget to run the tests (https://github.com/milligram/milligram/blob/master/.github/contributing.md#test) and check that your solution isn't breaking any one of them — if possible, add a new test showing the effectiveness of your solution.

@cjpatoilo
Copy link
Member

@mapio thanks for helping @Lisagrant101

@mapio here you forgot adding the normalize.css support.
Please, let me know if you still need help.

@cjpatoilo cjpatoilo self-assigned this May 20, 2020
@mapio
Copy link
Author

mapio commented May 20, 2020

@mapio here you forgot adding the normalize.css support.

I've added it now, it seems not to change the status of the issue.

@cjpatoilo
Copy link
Member

@RamanaVem You can find the Table module here ./src/_Table.sass

@cjpatoilo
Copy link
Member

cjpatoilo commented May 20, 2020

@mapio I can is wrong, but as I understand it:

The problem is not when you use any attribute but when you use the example structure:

<table>
  <tr>
    <th>Animals</th>
  </tr>
  <tr>
    <th>Hippopotamus</th>
  </tr>
  <tr>
    <th>Horse</th>
    <td>Mare</td>
  </tr>
  <tr>
    <td>Stallion</td>
  </tr>
  <tr>
    <th>Crocodile</th>
  </tr>
  <tr>
    <th>Chicken</th>
    <td>Hen</td>
  </tr>
  <tr>
    <td>Rooster</td>
  </tr>
</table>

Note, this behavior is generated by:

td,
th {
  padding: 1.2rem 1.5rem;
}
td:last-child, 
th:last-child {
    padding-right: 0;
}
td:first-child,
th:first-child {
    padding-left: 0;
}

And even if you remove the attributes, there will still be "left white-space" in the same elements. Look: https://codepen.io/cjpatoilo/pen/yLYGQNy

So, we need to find some solution to soften this behavior when there is this specific structure or remove this spacing by default in all table styles.

@mapio
Copy link
Author

mapio commented May 20, 2020

I'm not sure to get your point.

My bug report is based on https://github.com/mdn/learning-area/blob/master/html/tables/basic/animals-table-fixed.html that (coming from MDN) I assume to be authoritative (even if it does not include thead and tbody elements, that are indeed optional as per HTML standard).

Unfortunately I'm no CSS expert and I can't fix the bug, or understand the reason why your CSS style makes it happen.

What is sure is that the above HTML example is valid and is rendered correctly unless you use your CSS style.

@cjpatoilo cjpatoilo added bug and removed help wanted labels May 20, 2020
@cjpatoilo
Copy link
Member

cjpatoilo commented May 20, 2020

@mapio try to use:

th + td {
  padding-left: 0;
}

This code fixes the "white-space" in this specific example. Look:
https://codepen.io/cjpatoilo/pen/yLYGQNy

@mapio
Copy link
Author

mapio commented May 20, 2020

If what you suggest is a fix, please implement it in the library and release a new version.

@cjpatoilo
Copy link
Member

@mapio the code above is not the final solution for a possible fix. There are other ways to get the same result. Look: https://codepen.io/cjpatoilo/pen/bGVOQzd

So, to make changes in Milligram I need to understand better all scenes to ensure that expected behavior. I've been work on a new version v1.4.0. Let me see what I can do for this.

Thank you for your contribution and for reporting this example.

tusharck added a commit to tusharck/milligram that referenced this issue Oct 12, 2020
tusharck added a commit to tusharck/milligram that referenced this issue Oct 13, 2020
tusharck added a commit to tusharck/milligram that referenced this issue Oct 13, 2020
@srishtij2000
Copy link

Can I work on this issue?

@mapio
Copy link
Author

mapio commented Oct 21, 2020

Can I work on this issue?

I'm not the maintainer, but I can't see why you shouldn't!

@srishtij2000
Copy link

Okay

@tusharck
Copy link

hi @mapio , i made a PR for this issue, please review.

@mapio
Copy link
Author

mapio commented Oct 24, 2020

Dear @tusharck I'm not the maintainer of this project… for what it is worth, it seems that #274 fixes this bug, but I'm unable to accept PR for the project.

@tusharck
Copy link

tusharck commented Oct 24, 2020

Hi @cjpatoilo , as @mapio said, the PR #274 made fixes the issue, can you please review it.

@Zaid-Parkar
Copy link

Hello Sir,
I would like to contribute to this project,
I am new to hacktoctoberfest and this would be a great beginning.
Thank you...

@TRIPATHISHIWANSHI
Copy link

Hello Sir,
I am new to Hactoberfest and I would like to contribute to this project

@Yugalsaini123
Copy link

I am a beginner, can i also contribute to this project?

@shaaoni
Copy link

shaaoni commented Oct 6, 2023

Hey @mapio Is this still open ? Then I want to contribute to it.

@Yugalsaini123
Copy link

Yugalsaini123 commented Oct 7, 2023 via email

@GitGuySu
Copy link

I am new to Hacktoberfest. If this issue is still open, I wanna contribute to this.

@mapio
Copy link
Author

mapio commented Oct 16, 2023

The last commit appears to be in 2020. This is probably an abandoned project. Not sure the maintainer will accept PRs.

@mapio mapio closed this as completed Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests